﻿using Microsoft.Phone.Controls;
using WP7UIKit.ViewModel;

namespace WP7UIKit
{
    public partial class MainPage : PhoneApplicationPage
    {
        private MainViewModel _mainViewModel;

        public MainPage()
        {
            InitializeComponent();
            _mainViewModel = this.DataContext as MainViewModel;
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            _mainViewModel.OnNavigatedTo(this, e);
        }

        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            _mainViewModel.OnNavigatedFrom(this, e);
        }
    }
}
